/*自定义一个学生类，创建map以Student作为键,学生分数作为值，实现学生的增删改查操作*/
#include <iostream>
using namespace std;
#include <map>
#include <string>

class Student
{
friend ostream& operator<<(ostream out,const Student rhs);
private:
    int id;
    string name;
public:
    Student(int id,string name)
    :id(id),name(name){}
    bool operator < (const Student rhs)
    {
        return this->name < rhs.name;
    }
    string getName()const
    {
        return name;
    }
    int getId()
    {
        return id;
    }
};

ostream& operator<<(ostream out,const Student rhs)
{
    out<<rhs.id<<"\t"<<rhs.name;
    return out;
}

bool cmp(const Student& lhs,const Student& rhs)
{
    return lhs.getName() < rhs.getName();
}

int main(int argc,char **argv)
{
    map<Student,double> stus;
    Student tom(1,"tom");
    Student jack(3,"jack");
    Student bob(5,"bob");

    stus.insert(pair<Student,double>(tom,60));
    stus.insert(pair<Student,double>(jack,60));
    stus.insert(pair<Student,double>(bob,60));

    
    return 0;
}
